#!/bin/bash
#Use to quota user
#Usage:
#

###====================Definition Part==========================###
#Mount Point definition
MPoint=/dev/sda3

#Quota User definition
User=xueyuan 

#Soft limit of block definition
Sblock=519045120

#Hard limit of block definition
Hblock=524288000

#Soft limit of inode definition
Sinode=250

#Hard limit of inode definition
Hinode=255 
###========================End Definition===============================####

IsRoot=0;

if [ "$UID" -ne "$IsRoot" ]
then
	echo "Only root user can do this";
	exit 1;
fi

setquota -u $User $Sblock $Hblock $Sinode $Hinode $MPoint;

if [ $? = 0 ]
then

	echo "Quota user successful!"
else
	echo "Failed to quota user!!!!!"
fi
